package org.mendoza.salud.hvt.client.local;

import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.Window;
import org.jboss.errai.bus.client.api.UncaughtException;
import org.jboss.errai.enterprise.client.jaxrs.api.RestClient;
import org.jboss.errai.ioc.client.api.EntryPoint;

import javax.annotation.PostConstruct;

@EntryPoint
public class App {

    @PostConstruct
    public void onLoad() {
        RestClient.setApplicationRoot("/Personal/rest");
    }

    @UncaughtException
    private void onUncaughtException(Throwable caught) {
        try {
            throw caught;
        }
        catch (Throwable t) {
            Window.alert(t.getMessage() + "\t" + t.getCause());
            GWT.log("An unexpected error has occurred", t);
        }
    }


}